home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Networking & Communications / Serial NB Sample Driver / Task / inc / open.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-15  |  1.8 KB  |  93 lines  |  [TEXT/MPS ]

  1. /********************************************************************************/
  2. /*                                                                                */
  3. /*        open.c - open request processing.                                        */
  4. /*                                                                                */
  5. /*        Richard W. Mincher.  February 19, 1990.                                    */
  6. /*                                                                                */
  7. /*        Copyright © 1990 Apple Computer, Inc.  All rights reserved.                */
  8. /*                                                                                */
  9. /********************************************************************************/
  10.  
  11. #include    "AROSE.h"
  12. #include    "os.h"
  13. #include    "managers.h"
  14.  
  15. #include    "ARDriver.h"
  16. #include    "ARTask.h"
  17.  
  18. OpenCall()
  19. {        
  20.     G->myTid = msg->mTo;
  21.     G->hisTid = msg->mFrom;
  22.     
  23. #ifdef    DEBUG
  24.     printf("Open received.\n");
  25. #endif    DEBUG
  26.  
  27. //
  28. //    Allocate transmit buffers.
  29. //
  30.  
  31.     G->txIn = G->txFirst = G->txOut = GetMem( SIZETX );
  32.     G->txLast = G->txFirst + SIZETX;
  33.     G->txMax = SIZETX;
  34.     G->txCount = G->sTxCount = 0;
  35.     G->txTickle = 0;
  36.     G->txQHead = G->txQTail = 0;
  37.     
  38.     G->txSignal = GetMsg();
  39.     G->txSignal->mTo = G->txSignal->mFrom;
  40.     G->txSignal->mCode = 1000;
  41.  
  42. //
  43. //    Allocate receive buffers.
  44. //
  45.  
  46.     G->rxIn = G->rxFirst = G->rxOut = GetMem( SIZERX );
  47.     G->rxLast = G->rxFirst + SIZERX;
  48.     G->rxMax = G->rxCount = SIZERX;
  49.     G->sRxCount = 0;
  50.     G->rxTickle = 0;
  51.     G->rxQHead = G->rxQTail = 0;
  52.     
  53.     G->rxSignal = GetMsg();
  54.     G->rxSignal->mTo = G->rxSignal->mFrom;
  55.     G->rxSignal->mCode = 2000;
  56.     
  57. //    Initialize globals.
  58.  
  59.     G->peChar = 0;
  60.     G->altChar = 0;
  61.     G->flowOff = 0;
  62.     G->asyncErr = 0;
  63.     G->ctlOptions = 0;
  64.     G->xOffFlag = 0;
  65.     G->swhs = 0;
  66.     G->hwhs = 0;
  67.     G->sendXOnff = 0;
  68.     G->CTSFlag = 0;
  69.     G->charMask = 0xFF;
  70.     G->xOnChar = 0x13;
  71.     G->xOffChar = 0x11;
  72.     G->options = 0;
  73.     G->postOptions = 0;
  74.     G->inSwHs = 0;
  75.     G->inHwHs = 0;
  76.     G->moreTx = 0;
  77.     G->readCmd = 0;
  78.     G->writeCmd = 0;
  79.     
  80. //    Set up SCC.
  81.  
  82.     G->baudLow = 0x16;
  83.     G->baudHigh = 0x00;
  84. //    baudLow = 0xFE;    baudHigh = 0x11;    /*    50 Baud    */
  85.     G->lastWR4 = 0x44;
  86.     G->lastWR3 = 0xC1;
  87.     G->lastWR5 = 0xEA;
  88.     G->prevStat = 0;
  89.     
  90.     InitSCC();
  91. }
  92.  
  93.